package com.csi.okr.mobile.common.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 与O（目标）表（T_OKR_OBJECTIVES）对应的实体类
 * 
 */
@Entity
@Table(name = "T_OKR_OBJECTIVES", schema = "PSGIS")
public class TOkrObjectives implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	/**
	 * O唯一标识码
	 */
	private String OUniqueIdCode;
	/**
	 * 责任人码
	 */
	private String personLiableCode;
	/**
	 * 责任人名
	 */
	private String personLiableName;
	private String personLiablePostname;
	private String ownerDeptcode;
	/**
	 * 年份
	 */
	private BigDecimal OYear;
	/**
	 * 季度
	 */
	private String OQuarter;
	/**
	 * 月份
	 */
	private String OMonth;
	/**
	 * O码
	 */
	private String OCode;
	/**
	 * kr来源
	 */
	private String okrSource;
	/**
	 * O的定义
	 */
	private String ODefinition;
	/**
	 * 状态
	 */
	private String OState;
	private BigDecimal isVisibleOverall;
	private BigDecimal isVisibleSuperior;
	private BigDecimal isVisibleSubordinate;
	private BigDecimal isVisibleDesignated;
	private Date fillingTime;
	private String designatedApplyerCode;
	private String designatedApplyerName;
	private Date designatedApplyTime;
	private Date deliveryTime;
	private String applicationEndReasons;
	private Date applicationEndTime;
	private String verificationOverPersonCode;
	private String verificationOverPersonName;
	private Date verificationOverTime;
	private String parentOkrRelationType;
	private String parentOkrUniqueIdCode;
	private Serializable versionTag;
	private String versionCode;
	private String okrChangeReason;
	private String okrChangeContent;


	public TOkrObjectives() {
	}

	public TOkrObjectives(String OUniqueIdCode) {
		this.OUniqueIdCode = OUniqueIdCode;
	}

	public TOkrObjectives(String OUniqueIdCode, String personLiableCode, String personLiableName,
			String personLiablePostname, String ownerDeptcode, BigDecimal OYear, String OQuarter, String OMonth,
			String OCode, String okrSource, String ODefinition, String OState, BigDecimal isVisibleOverall,
			BigDecimal isVisibleSuperior, BigDecimal isVisibleSubordinate, BigDecimal isVisibleDesignated,
			Date fillingTime, String designatedApplyerCode, String designatedApplyerName,
			Date designatedApplyTime, Date deliveryTime, String applicationEndReasons,
			Date applicationEndTime, String verificationOverPersonCode, String verificationOverPersonName,
			Date verificationOverTime, String parentOkrRelationType, String parentOkrUniqueIdCode,
			Serializable versionTag, String versionCode, String okrChangeReason, String okrChangeContent) {
		this.OUniqueIdCode = OUniqueIdCode;
		this.personLiableCode = personLiableCode;
		this.personLiableName = personLiableName;
		this.personLiablePostname = personLiablePostname;
//		this.ownerDeptcode = ownerDeptcode;
		this.OYear = OYear;
		this.OQuarter = OQuarter;
		this.OMonth = OMonth;
		this.OCode = OCode;
		this.okrSource = okrSource;
		this.ODefinition = ODefinition;
		this.OState = OState;
		this.isVisibleOverall = isVisibleOverall;
		this.isVisibleSuperior = isVisibleSuperior;
		this.isVisibleSubordinate = isVisibleSubordinate;
		this.isVisibleDesignated = isVisibleDesignated;
		this.fillingTime = fillingTime;
		this.designatedApplyerCode = designatedApplyerCode;
		this.designatedApplyerName = designatedApplyerName;
		this.designatedApplyTime = designatedApplyTime;
		this.deliveryTime = deliveryTime;
		this.applicationEndReasons = applicationEndReasons;
		this.applicationEndTime = applicationEndTime;
		this.verificationOverPersonCode = verificationOverPersonCode;
		this.verificationOverPersonName = verificationOverPersonName;
		this.verificationOverTime = verificationOverTime;
		this.parentOkrRelationType = parentOkrRelationType;
		this.parentOkrUniqueIdCode = parentOkrUniqueIdCode;
		this.versionTag = versionTag;
		this.versionCode = versionCode;
		this.okrChangeReason = okrChangeReason;
		this.okrChangeContent = okrChangeContent;
	}

	@Id

	@Column(name = "O_UNIQUE_ID_CODE", unique = true, nullable = false, length = 20)
	public String getOUniqueIdCode() {
		return this.OUniqueIdCode;
	}

	public void setOUniqueIdCode(String OUniqueIdCode) {
		this.OUniqueIdCode = OUniqueIdCode;
	}

	@Column(name = "PERSON_LIABLE_CODE", length = 12)
	public String getPersonLiableCode() {
		return this.personLiableCode;
	}

	public void setPersonLiableCode(String personLiableCode) {
		this.personLiableCode = personLiableCode;
	}

	@Column(name = "PERSON_LIABLE_NAME", length = 16)
	public String getPersonLiableName() {
		return this.personLiableName;
	}

	public void setPersonLiableName(String personLiableName) {
		this.personLiableName = personLiableName;
	}

	@Column(name = "PERSON_LIABLE_POSTNAME", length = 16)
	public String getPersonLiablePostname() {
		return this.personLiablePostname;
	}

	public void setPersonLiablePostname(String personLiablePostname) {
		this.personLiablePostname = personLiablePostname;
	}

	@Column(name = "OWNER_DEPTCODE", length = 16)
	public String getOwnerDeptcode() {
		return this.ownerDeptcode;
	}

	public void setOwnerDeptcode(String ownerDeptcode) {
		this.ownerDeptcode = ownerDeptcode;
	}

	@Column(name = "O_YEAR", precision = 22, scale = 0)
	public BigDecimal getOYear() {
		return this.OYear;
	}

	public void setOYear(BigDecimal OYear) {
		this.OYear = OYear;
	}

	@Column(name = "O_QUARTER", length = 2)
	public String getOQuarter() {
		return this.OQuarter;
	}

	public void setOQuarter(String OQuarter) {
		this.OQuarter = OQuarter;
	}

	@Column(name = "O_MONTH", length = 2)
	public String getOMonth() {
		return this.OMonth;
	}

	public void setOMonth(String OMonth) {
		this.OMonth = OMonth;
	}

	@Column(name = "O_CODE", length = 2)
	public String getOCode() {
		return this.OCode;
	}

	public void setOCode(String OCode) {
		this.OCode = OCode;
	}

	@Column(name = "OKR_SOURCE", length = 2)
	public String getOkrSource() {
		return this.okrSource;
	}

	public void setOkrSource(String okrSource) {
		this.okrSource = okrSource;
	}

	@Column(name = "O_DEFINITION", length = 256)
	public String getODefinition() {
		return this.ODefinition;
	}

	public void setODefinition(String ODefinition) {
		this.ODefinition = ODefinition;
	}

	@Column(name = "O_STATE", length = 2)
	public String getOState() {
		return this.OState;
	}

	public void setOState(String OState) {
		this.OState = OState;
	}

	@Column(name = "IS_VISIBLE_OVERALL", precision = 22, scale = 0)
	public BigDecimal getIsVisibleOverall() {
		return this.isVisibleOverall;
	}

	public void setIsVisibleOverall(BigDecimal isVisibleOverall) {
		this.isVisibleOverall = isVisibleOverall;
	}

	@Column(name = "IS_VISIBLE_SUPERIOR", precision = 22, scale = 0)
	public BigDecimal getIsVisibleSuperior() {
		return this.isVisibleSuperior;
	}

	public void setIsVisibleSuperior(BigDecimal isVisibleSuperior) {
		this.isVisibleSuperior = isVisibleSuperior;
	}

	@Column(name = "IS_VISIBLE_SUBORDINATE", precision = 22, scale = 0)
	public BigDecimal getIsVisibleSubordinate() {
		return this.isVisibleSubordinate;
	}

	public void setIsVisibleSubordinate(BigDecimal isVisibleSubordinate) {
		this.isVisibleSubordinate = isVisibleSubordinate;
	}

	@Column(name = "IS_VISIBLE_DESIGNATED", precision = 22, scale = 0)
	public BigDecimal getIsVisibleDesignated() {
		return this.isVisibleDesignated;
	}

	public void setIsVisibleDesignated(BigDecimal isVisibleDesignated) {
		this.isVisibleDesignated = isVisibleDesignated;
	}

	@Column(name = "FILLING_TIME")
	public Date getFillingTime() {
		return this.fillingTime;
	}

	public void setFillingTime(Date fillingTime) {
		this.fillingTime = fillingTime;
	}

	@Column(name = "DESIGNATED_APPLYER_CODE", length = 12)
	public String getDesignatedApplyerCode() {
		return this.designatedApplyerCode;
	}

	public void setDesignatedApplyerCode(String designatedApplyerCode) {
		this.designatedApplyerCode = designatedApplyerCode;
	}

	@Column(name = "DESIGNATED_APPLYER_NAME", length = 16)
	public String getDesignatedApplyerName() {
		return this.designatedApplyerName;
	}

	public void setDesignatedApplyerName(String designatedApplyerName) {
		this.designatedApplyerName = designatedApplyerName;
	}

	@Column(name = "DESIGNATED_APPLY_TIME")
	public Date getDesignatedApplyTime() {
		return this.designatedApplyTime;
	}

	public void setDesignatedApplyTime(Date designatedApplyTime) {
		this.designatedApplyTime = designatedApplyTime;
	}

	@Column(name = "DELIVERY_TIME")
	public Date getDeliveryTime() {
		return this.deliveryTime;
	}

	public void setDeliveryTime(Date deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	@Column(name = "APPLICATION_END_REASONS", length = 1024)
	public String getApplicationEndReasons() {
		return this.applicationEndReasons;
	}

	public void setApplicationEndReasons(String applicationEndReasons) {
		this.applicationEndReasons = applicationEndReasons;
	}

	@Column(name = "APPLICATION_END_TIME")
	public Date getApplicationEndTime() {
		return this.applicationEndTime;
	}

	public void setApplicationEndTime(Date applicationEndTime) {
		this.applicationEndTime = applicationEndTime;
	}

	@Column(name = "VERIFICATION_OVER_PERSON_CODE", length = 12)
	public String getVerificationOverPersonCode() {
		return this.verificationOverPersonCode;
	}

	public void setVerificationOverPersonCode(String verificationOverPersonCode) {
		this.verificationOverPersonCode = verificationOverPersonCode;
	}

	@Column(name = "VERIFICATION_OVER_PERSON_NAME", length = 16)
	public String getVerificationOverPersonName() {
		return this.verificationOverPersonName;
	}

	public void setVerificationOverPersonName(String verificationOverPersonName) {
		this.verificationOverPersonName = verificationOverPersonName;
	}

	@Column(name = "VERIFICATION_OVER_TIME")
	public Date getVerificationOverTime() {
		return this.verificationOverTime;
	}

	public void setVerificationOverTime(Date verificationOverTime) {
		this.verificationOverTime = verificationOverTime;
	}

	@Column(name = "PARENT_OKR_RELATION_TYPE", length = 2)
	public String getParentOkrRelationType() {
		return this.parentOkrRelationType;
	}

	public void setParentOkrRelationType(String parentOkrRelationType) {
		this.parentOkrRelationType = parentOkrRelationType;
	}

	@Column(name = "PARENT_OKR_UNIQUE_ID_CODE", length = 18)
	public String getParentOkrUniqueIdCode() {
		return this.parentOkrUniqueIdCode;
	}

	public void setParentOkrUniqueIdCode(String parentOkrUniqueIdCode) {
		this.parentOkrUniqueIdCode = parentOkrUniqueIdCode;
	}

	@Column(name = "VERSION_TAG")
	public Serializable getVersionTag() {
		return this.versionTag;
	}

	public void setVersionTag(Serializable versionTag) {
		this.versionTag = versionTag;
	}

	@Column(name = "VERSION_CODE", length = 2)
	public String getVersionCode() {
		return this.versionCode;
	}

	public void setVersionCode(String versionCode) {
		this.versionCode = versionCode;
	}

	@Column(name = "OKR_CHANGE_REASON", length = 1024)
	public String getOkrChangeReason() {
		return this.okrChangeReason;
	}

	public void setOkrChangeReason(String okrChangeReason) {
		this.okrChangeReason = okrChangeReason;
	}

	@Column(name = "OKR_CHANGE_CONTENT", length = 1024)
	public String getOkrChangeContent() {
		return this.okrChangeContent;
	}

	public void setOkrChangeContent(String okrChangeContent) {
		this.okrChangeContent = okrChangeContent;
	}

	/**
	 * O目标表与部门视图关联
	 */
	private VOkrOrg vOkrOrg;
	
	@OneToOne
	@JoinColumn (name= "OWNER_DEPTCODE",referencedColumnName="ORG_CODE",insertable=false,updatable=false)
	public VOkrOrg getvOkrOrg() {
		return vOkrOrg;
	}

	public void setvOkrOrg(VOkrOrg vOkrOrg) {
		this.vOkrOrg = vOkrOrg;
	}

	private TOkrScoreDetailObjectives tokrscoredetailobjectives;

	@OneToOne(targetEntity=TOkrScoreDetailObjectives.class,cascade=CascadeType.ALL,mappedBy="tOkrObj",fetch=FetchType.LAZY)
	public TOkrScoreDetailObjectives getTokrscoredetailobjectives() {
		return tokrscoredetailobjectives;
	}

	public void setTokrscoredetailobjectives(TOkrScoreDetailObjectives tokrscoredetailobjectives) {
		this.tokrscoredetailobjectives = tokrscoredetailobjectives;
	}


}
